NodeManager={}
NodeManager.name2object={}
NodeManager.object2name={}
NodeManagerFunc={}
NodeManagerFunc.__index=NodeManagerFunc
setmetatable(NodeManager, NodeManagerFunc)

NodeManagerFunc.addObject = function(self,name,obj)
  --print(self,name,obj)
  self.name2object[name] = obj
  self.object2name[tostring(obj)] = name
end
NodeManagerFunc.getObject = function(self,name)
  return self.name2object[name]
end
NodeManagerFunc.getName = function(self,obj)
  return self.object2name[tostring(obj)]
end

print(NodeManager)
t={}
print(t)
NodeManager:addObject("test",t)

print("obj",NodeManager:getObject("test"))
print("name",NodeManager:getName(t))
